Skip to main content

All Questions

3votes
1answer
77views

I made a webpage that simulates sharks eating fish in the torrid world of Wa-tor

I've been self-studying HTML/CSS/JS. I read about Wa-tor. It's a population dynamics simulation which simulates fish and sharks breeding and predating. This seemed cool so I decided to implement it....
Jeff's user avatar
2votes
0answers
165views

How do I create an "Environment Variable Setter"?

I have a NodeJS/Typescript project. In server.js, I want to set my environment variables from a .env file. To achieve this, I am ...
ptk's user avatar
  • 121
0votes
1answer
60views

Avoiding verbose compositional class design

I've written some code which features Eric Elliot's javascript factory function mixin composition (https://medium.com/javascript-scene/javascript-factory-functions-with-es6-4d224591a8b1), but since ...
Li Brary's user avatar
4votes
2answers
365views

web scraper for emails and links

I created a class to scrape URLS, parse and validate emails and get internal links. How can I achieve the SOLID principles in this class written in Javascript to make a web scraper? ...
biel sala's user avatar
2votes
1answer
132views

Tile and grid abstraction

This question is a small subset of the problem I am trying to solve. I am trying to learn to break problems into better abstractions. The original problem I am trying to solve is: Write a JS ...
CodeYogi's user avatar
2votes
0answers
47views

Method for creating and traversing a BST while also getting its depth and width

This is a class for creating and traversing a BST while also getting its depth and width. I feel like this can be factored down into something more elegant and shorter I also feel like the overall ...
Rick's user avatar
  • 586
1vote
1answer
2kviews

Splitwise clone done right

I have started this project basically for learning perspective and wanted to learn good object oriented design. What I am trying to do is making clone of something like this but this is a command line ...
CodeYogi's user avatar
2votes
1answer
150views

Modelling an account manager in OOP

I have this task of modelling a system where given a group of users each can keep track of their expenses. The basic requirements are as followed: To be able to give credit to an user. Find all the ...
CodeYogi's user avatar
1vote
1answer
613views

Using decorator pattern to validate an entity

I am following this article. ...
CodeYogi's user avatar
1vote
1answer
78views

JavaScript class for a GameRoom

I am new to object oriented design with JavaScript and am trying to make a PublicGame class with some methods that puts itself in a map of games. It calls ...
Daniel Jacobson's user avatar
1vote
2answers
166views

From scratch pub sub definition and implementation

I am finished with my implementation of PUB/SUB or Observer pattern, however I just want to see any ways that I may be able to improve this pattern. I wanted to be able to use the typical ...
NicholasAbrams's user avatar
1vote
2answers
223views

Separate Ajax code in separate modules

This is the first time I am working on OOJS code and I am a beginner in JS. I think I have pretty much messed it up. I am planning to modularize my code, but with the inclusion of ...
Thomas Sebastian's user avatar
1vote
1answer
2kviews

MVC + Events in JavaScript

I'm a bit lost with implementing MCV pattern on javascript. Where should events (such as 'click','change') come in on MVC in javascript? I have this event function, ...
Run's user avatar
  • 183
2votes
1answer
931views

Markov text generator

This is a Markov text generator I've created in JavaScript. I'm pretty sure the term "Markov" applies, anyway. The way the generator works is like this: it first divides the source text into unique "...
vvye's user avatar
  • 699
3votes
1answer
129views

Functional organisation of JavaScript functions

In one of the web apps I contribute to, the main.js file has multiple interacting "objects". Unfortunately, I'm so bad at OOP in JavaScript, despite studying other ...
Seanny123's user avatar

153050per page
close